﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.ServiceModel;

using Paxos;

namespace SURLService
{
    [DataContract]
    public class NewURLCommand : PaxosCommand
    {
        [DataMember]
        public string URL;

        public override void Commit(ReplicaStateMachine state)
        {
            SURLServer server = state as SURLServer;
            if (server == null)
            {
                throw new ArgumentException();
            }

            server._dict.New(URL);
        }

        public override string ToString()
        {
            return String.Format("Add Entry {0}", URL);
        }
    }

}
